/**
 * Created by hang on 14-5-11.
 */
var pageNum = 1;
var host = "";
$(document).ready(function () {
	host = "http://114.215.121.115/xipujewelWeb";
    $(".zuan_nav .a1").click(function () {
        $(this).siblings(".a1").removeClass("cur");
        $(this).addClass("cur");
        pageNum = 1;
        $.post(host + "/ring/search",
            {typeName: $(".a1.cur").text()},
            function (data) {
                $(data).replaceAll($("#list"));
                $("#typeTitle").text($(".a1.cur").text());
            });
    });

    setShopCartCount();
})


function setShopCartCount(){
    $.post(host + "/ShopCart/getShopCartCount",function (data) {
        if (data != null) {
            $("#shopCartCount").text(data);
            $("#shopCartCount2").text(data);
        }
    });
}
function more(){
	$("#moreTr").text("正在加载，请稍后...");
    var typeName = $(".a1.cur").text();
    pageNum = pageNum + 1;
    $.post(host + "/ring/more",
        {typeName: $(".a1.cur").text(),page:pageNum},
        function (data) {
        	$("#moreTr").text("点击加载更多");
            $("#listEnd").before($(data));
            $("#typeTitle").text($(".a1.cur").text());
        });

}
